﻿@using WebEntities;
@using Tools.com.Pager;

@model PagedList<WI_News>

@{
    ViewBag.Title = ViewBag.CataName + "_文章列表_城市垃圾处理网";
    ViewBag.ClassHead = "head_bg2";
}
<div class="listMain">
    <div class="main_l">
        @Html.Action("CircleMenu", "PublicPartialView", new { id = (int)ViewBag.ArgID })
        <div class="contentBox">
            <div class="searchArea">
            @using (Html.BeginForm("searchnews", "list"))
            {
                <div class="tit">
                    查找文章</div>
                @Html.TextBox("search", null, new { maxlength = "20", placeholder = "请输入搜索内容", Class = "txtInp" })
                <select name="stype">
                    <option value="newsTitle">按标题查找</option>
                    <option value="newsDescr">按内容查找</option>
                </select>
                <input type="submit" value="" class="btnSearch" />
            }
            </div>
        </div>
        <div class="contentBox">
            <div class="con_bar">
                <span class="fl tit">最新资讯动态</span>
                <div class="cls">
                </div>
            </div>
            <div class="con_Main_2">
                <ul>
                    @{
                        List<WI_News> ltnewsLst = ViewBag.LeftNewsList as List<WI_News>;
                        foreach (var news in ltnewsLst)
                        {
                        <li><a href="/detail/index/@news.NewsID" target="_blank">@news.NewsTitle</a> [@((news.PubTime ?? news.CreateTime).ToString("yyyy-MM-dd"))]</li>
                        }
                    }
                </ul>
            </div>
        </div>
        @Html.Action("Contact", "PublicPartialView")
    </div>
    <div class="main_r">
        @Html.Action("PageCurrentPath", "PublicPartialView", new { id = (int)ViewBag.ArgID })
        <div class="contentBox">
            <div class="tab">
                <ul>
                    <li class="current"><a href="/list/index/@ViewBag.CataID">@ViewBag.CataName</a></li>
                </ul>
                <span class="subitem">
                    @{
                        List<WI_NewsCata> cataList = ViewBag.NewsCataList as List<WI_NewsCata>;
                        for (int i = 0; i < cataList.Count; i++)
                        {
                        <a href="/list/index/@cataList[i].CataID">@cataList[i].CataName</a>
                            if (i < cataList.Count - 1)
                            {
                        @: |
                            }
                        }
                    }
                </span>
            </div>
            <div class="tab-content">
                <div class="list-show">
                    <ul>
                        @{
                            int count = 0;
                            foreach (var news in Model)
                            {
                                string mark = (news.Important == 2) ? "red" : "";
                            <li><span class="fl">· <a href="/detail/index/@news.NewsID" target="_blank" title="@news.NewsTitle" class="@mark">@news.NewsTitle</a></span>
                                <span class="gray fr">@((news.PubTime ?? news.CreateTime).ToString("yyyy-MM-dd"))</span>
                                <div class="cls">
                                </div>
                            </li> 
                                count++;
                                if (count % 5 == 0)
                                {
                            <div class="line">
                            </div> 
                                }
                            }
                        }
                    </ul>
                    @Html.Pager(Model, new PagerOptions
                       {
                           PageIndexParameterName = "page",
                           CurrentPagerItemWrapperFormatString = "<a class=\"mvc-paged\">{0}</a>",
                           CssClass = "mvc-pager",
                           HorizontalAlign = "center"
                       })
                </div>
                <div class="cls">
                </div>
            </div>
        </div>
    </div>
</div>
